package com.example.doctorsystem.service.impl;

import com.example.doctorsystem.dao.PatientDao;
import com.example.doctorsystem.model.Patient;
import com.example.doctorsystem.service.PatientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PatientServiceImpl implements PatientService {

    @Autowired
    private PatientDao patientDao;

    @Override
    public int register(Patient patient) {
        return patientDao.insert(patient);
    }

    @Override
    public Patient login(String email, String password) {
        return patientDao.login(email, password);
    }

    @Override
    public List<Patient> getAllPatients() {
        return patientDao.findAll();
    }
}
